package com.stefanini.pe.bbva.bp.in.bo.datasource;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRField;

public class SubReporteInformacionPerfilamiento implements JRDataSource{
	
	private List listServ = new ArrayList();
    private int indexServ = -1;

    public SubReporteInformacionPerfilamiento(List listado) {
        listServ = listado;
    }

    public boolean next() throws JRException {
        indexServ++;
        return (indexServ < listServ.size());
    }

    public Object getFieldValue(JRField field) throws JRException {
        Object value = null;

        String fieldName = field.getName();

        HashMap object = (HashMap)listServ.get(indexServ);

        if ("titulo".equals(fieldName)) {
            value = object.get("titulo");
        }
        return value;
    }

    public void setListServ(List listServ) {
        this.listServ = listServ;
    }

    public List getListServ() {
        return listServ;
    }

    public void setIndexServ(int indexServ) {
        this.indexServ = indexServ;
    }

    public int getIndexServ() {
        return indexServ;
    }
}
